package com.imaker.action;

import com.imaker.domain.UserInfo;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class LoginValidateInterceptor extends AbstractInterceptor {

	@Override
	public String intercept(ActionInvocation inv) throws Exception {
		UserInfo userInfo = (UserInfo)ActionContext.getContext().getSession().get("user");
		if(userInfo==null){
			System.out.println("用户未登录，正在跳转…………");
			return "LOGIN";
		}else {
			return inv.invoke();
		}
		
	}

}
